﻿<shared:UserControlBase x:Class="HP.Cachalote.WPF.UserControls.TodoItemFilterUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:shared="clr-namespace:HP.Cachalote.WPF.Shared"                        
             xmlns:interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300" 
             DataContext="{Binding TodoItemFilterView, Source={StaticResource Locator}}">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Border Style="{StaticResource ListTitleBorder}">
            <TextBlock Text="Filters" Style="{StaticResource ListTitleTextBlock}" />
        </Border>
        <ListBox Grid.Row="1" x:Name="FilterList" BorderThickness="0">
            <ListBox.Resources>
                <SolidColorBrush Color="#d0e5fe" x:Key="{x:Static SystemColors.HighlightBrushKey}" />
                <SolidColorBrush Color="Black" x:Key="{x:Static SystemColors.HighlightTextBrushKey}" />
                <SolidColorBrush Color="#e9e9e9" x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" />
            </ListBox.Resources>
            <ListBox.ItemContainerStyle>
                <Style TargetType="{x:Type ListBoxItem}">
                    <Setter Property="FontSize" Value="15" />
                    <Style.Triggers>
                        <Trigger Property="IsFocused" Value="False">
                            <Setter Property="IsSelected" Value="False" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Foreground" Value="#9ac8ff" />
                            <Setter Property="FontWeight" Value="Bold" />
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </ListBox.ItemContainerStyle>
            <ListBoxItem>
                <interactivity:Interaction.Triggers>
                    <interactivity:EventTrigger EventName="PreviewMouseLeftButtonDown">
                        <interactivity:InvokeCommandAction Command="{Binding ItemClickCommand}" 
                                                       CommandParameter="All" />
                    </interactivity:EventTrigger>
                </interactivity:Interaction.Triggers>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="All" />
                    <TextBlock Grid.Column="1" Text="{Binding AllTodoItemCount}" Style="{StaticResource TodoItemCountTextBlock}" />
                </Grid>
            </ListBoxItem>
            <ListBoxItem>
                <interactivity:Interaction.Triggers>
                    <interactivity:EventTrigger EventName="PreviewMouseLeftButtonDown">
                        <interactivity:InvokeCommandAction Command="{Binding ItemClickCommand}" 
                                                       CommandParameter="Today" />
                    </interactivity:EventTrigger>
                </interactivity:Interaction.Triggers>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="Today" />
                    <TextBlock Grid.Column="1" Text="{Binding TodayTodoItemCount}" Style="{StaticResource TodoItemCountTextBlock}" />
                </Grid>
            </ListBoxItem>
            <ListBoxItem>
                <interactivity:Interaction.Triggers>
                    <interactivity:EventTrigger EventName="PreviewMouseLeftButtonDown">
                        <interactivity:InvokeCommandAction Command="{Binding ItemClickCommand}" 
                                                       CommandParameter="Tomorrow" />
                    </interactivity:EventTrigger>
                </interactivity:Interaction.Triggers>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="Tomorrow" />
                    <TextBlock Grid.Column="1" Text="{Binding TomorrowTodoItemCount}" Style="{StaticResource TodoItemCountTextBlock}" />
                </Grid>
            </ListBoxItem>
            <ListBoxItem>
                <interactivity:Interaction.Triggers>
                    <interactivity:EventTrigger EventName="PreviewMouseLeftButtonDown">
                        <interactivity:InvokeCommandAction Command="{Binding ItemClickCommand}" 
                                                       CommandParameter="Next" />
                    </interactivity:EventTrigger>
                </interactivity:Interaction.Triggers>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="Next" />
                    <TextBlock Grid.Column="1" Text="{Binding NextTodoItemCount}" Style="{StaticResource TodoItemCountTextBlock}" />
                </Grid>
            </ListBoxItem>
            <ListBoxItem>
                <interactivity:Interaction.Triggers>
                    <interactivity:EventTrigger EventName="PreviewMouseLeftButtonDown">
                        <interactivity:InvokeCommandAction Command="{Binding ItemClickCommand}" 
                                                       CommandParameter="Overdue" />
                    </interactivity:EventTrigger>
                </interactivity:Interaction.Triggers>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="Overdue" />
                    <TextBlock Grid.Column="1" Text="{Binding OverdueTodoItemCount}" Style="{StaticResource TodoItemCountTextBlock}" />
                </Grid>
            </ListBoxItem>
        </ListBox>
    </Grid>
</shared:UserControlBase>